package com.cnsoft.persistent.player.U101020PlayerAddress;

import org.cnsoft.framework.db.manager.MyDBTableSQLSupport;
import org.springframework.stereotype.Component;

/**
 * 会员收货地址表建表语句
 */
@Component("U101020PlayerAddressSQL")
//@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class U101020PlayerAddressSQL extends MyDBTableSQLSupport {
	// 表名
	public String getTableName() {
		return "u101020_player_address";
	}

	// 获得SQL内容
	public String getSQL() throws Exception {
		StringBuilder sqlStringBuilder = new StringBuilder();// 临时变量

		sqlStringBuilder.append("CREATE TABLE u101020_player_address");
		sqlStringBuilder.append("(");
		sqlStringBuilder.append("    id VARCHAR(64) NOT NULL COMMENT '流水ID',");
		sqlStringBuilder.append("    user_id VARCHAR(80) NOT NULL COMMENT '会员ID',");
		sqlStringBuilder.append("    consignee VARCHAR(80) COMMENT '收货人姓名',");
		sqlStringBuilder.append("    user_phone VARCHAR(40) NOT NULL COMMENT '手机号',");
		sqlStringBuilder.append("    addr_priv VARCHAR(80) COMMENT '所在省',");
		sqlStringBuilder.append("    addr_city VARCHAR(80) COMMENT '所在城市',");
		sqlStringBuilder.append("    addr_area VARCHAR(80) COMMENT '所在区县',");
		sqlStringBuilder.append("    address VARCHAR(400) COMMENT '地址信息',");
		sqlStringBuilder.append("    is_default VARCHAR(4) DEFAULT '1' COMMENT '是否默认收货地址（1普通2默认）',");
		sqlStringBuilder.append("    memo VARCHAR(200) COMMENT '备注',");
		sqlStringBuilder.append("    fb1 VARCHAR(40) COMMENT '备用1',");
		sqlStringBuilder.append("    fb2 VARCHAR(20) COMMENT '备用2',");
		sqlStringBuilder.append("    fb3 VARCHAR(50) COMMENT '备用3',");
		sqlStringBuilder.append("    fb4 VARCHAR(200) COMMENT '备用4',");
		sqlStringBuilder.append("    fb5 VARCHAR(80) COMMENT '备用5',");
		sqlStringBuilder.append("    eb1 VARCHAR(40) COMMENT '扩展1',");
		sqlStringBuilder.append("    eb2 VARCHAR(80) COMMENT '扩展2',");
		sqlStringBuilder.append("    eb3 VARCHAR(20) COMMENT '扩展3',");
		sqlStringBuilder.append("    eb4 VARCHAR(10) COMMENT '扩展4',");
		sqlStringBuilder.append("    eb5 VARCHAR(20) COMMENT '扩展5',");
		sqlStringBuilder.append("    sid VARCHAR(20) COMMENT '数据归属系统',");
		sqlStringBuilder.append("    del_flag CHAR(1) DEFAULT '0' COMMENT '有效标识',");
		sqlStringBuilder.append("    create_time VARCHAR(24) DEFAULT '2018-02-02' NOT NULL COMMENT '创建时间',");
		sqlStringBuilder.append("    creator VARCHAR(64) DEFAULT 'SYSTEM' NOT NULL COMMENT '创建者',");
		sqlStringBuilder.append("    update_time VARCHAR(24) COMMENT '更新时间',");
		sqlStringBuilder.append("    updator VARCHAR(64) COMMENT '最后更新者',");
		sqlStringBuilder.append("  PRIMARY KEY (id)");
		sqlStringBuilder.append(") COMMENT '会员收货地址表';");

		return sqlStringBuilder.toString();
	}

}
